<template>
  <div id="app">
    <router-view v-slot="{ Component }">
      <transition>
        <component :is="Component" />
      </transition>
    </router-view>

  </div>
</template>

<script>

export default {
  name: 'App',
  created() {
    // 查看当前路由
    if (this.$route.path !== '/') {
      // 在应用创建时检查并跳转到上次的路由路径
      const lastRoutePath = localStorage.getItem('path')
      if (lastRoutePath) {
        this.$router.push(lastRoutePath)
      } else {
        this.$router.push('/')
      }
    }
  },
}
</script>
<style scoped>
#nprogress .bar {
  background-color: #16c2a3 !important;
}

#app {
  width: 100%;
  height: 100vh;
  background-image: url('@/assets/bg_2.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
</style>
